using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using GNet.DataBase;
namespace GNetDesktop
{
    class DebugCenter
    {
        public static bool SendToDebugCenter(Exception ex,string ResourceID,string UserID,string ServiceID)
        {
            string strSQL;
            strSQL = "insert into GNET_DebugCenter(SendTime, ErrException, ResourceID, UserID, ServiceID) " +
                " values(GetDate(),'" + ex.ToString() + "','" + ResourceID + "','" + UserID + "','" + ServiceID + "')";
            try
            {
                DataComponent dbGnet = new DataComponent(true);
                dbGnet.ExecuteSQL(strSQL, true);
                dbGnet.Dispose();
                Application.DoEvents();
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
